<?php
	require_once 'Db/statement.php';
	require_once 'include_files.php';
	$db = new Webstar_Cassandra_Db();
	
	echo '<pre>';
	$keyspaces = $db->get_keyspaces();
	$keyspace_details = array();
	echo '<table border = "1">';
	echo '<thead><tr><td colspan="2">The keyspaces on the host</td></tr></thead><tbody>';
		echo '<tr>';
		echo '<td style="color:blue">Name</td>';
		echo '<td style="color:blue">Status</td>';
		echo '</tr>';
	foreach($keyspaces as $key=>$keyspace){
		echo '<tr>';
		echo '<td>'.$key.'</td>';
		echo '<td>'.$keyspace.'</td>';
		echo '</tr>';
		
		$keyspace_details[$key] = $db->get_keyspace($key); 
	}
	
	echo '</tbody></table>';
	
//	print_r($keyspace_details['BloggyAppy']);

	// Fetch the latest Slashdot headlines
		$zend_feed = new Zend_Feed();
		try {
			
		    $slashdotRss =
		        $zend_feed->import('http://www.bullogger.com/blogs/mikewolf/Rss.aspx');
		} catch (Zend_Feed_Exception $e) {
		    // feed import failed
		    echo "Exception caught importing feed: {$e->getMessage()}\n";
		    exit;
		}
		
		
		// Initialize the channel data array
		$channel = array(
					    'title'       => $slashdotRss->title(),
					    'link'        => $slashdotRss->link(),
					    'description' => $slashdotRss->description(),
					    'items'       => array()
    					);
    					
		// Loop over each channel item and store relevant data
		foreach ($slashdotRss as $item) {
    	$channel['items'][] = array(
							        'title'       => $item->title(),
							        'link'        => $item->link(),
							        'description' => $item->description(),
    								'guid'		  => $item->guid()
							        );
		}				
		
		echo "<pre>";
//		echo $slashdotRss->saveXmlFragment();
//		exit();
		echo "title: " .  $slashdotRss->title() . "<br/>";
		echo "link: " . $slashdotRss->link(). "<br/>";
		echo "language: " . $slashdotRss->language() . "<br/>";
		exit();
	exit();
	
?>
		